﻿using System.Windows.Media;
using System.Windows.Media.Media3D;

namespace Wen.UI.NavigationElements
{
	internal abstract class LightViewModelBase<T> : LightViewModelOfT where T : Light
	{
		private readonly Color _stockColor;

		private readonly T _light;
		protected T Light {
			get { return _light; }
		}

		private bool _isEnabled = true;
		public bool IsEnabled {
			get { return _isEnabled; }
			set {
				_isEnabled = value;
				_light.Color = value ? _stockColor : Colors.Black;
			}
		}

		internal LightViewModelBase(T light) {
			_light = light;
			_stockColor = light.Color;
		}

		public string Title {
			get {
				return typeof(T).Name;
			}
		}
	}
}
